﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace TD.TheGame
{
    public abstract class CastleSprite : Sprite
    {
        public SpriteEnumState upgradeState;
        public SpriteEnumState oldUpgradeState;

        public int MaxHealth
        {
            get;
            set;
        }

        public int Health
        {
            get;
            set;
        }

        public CastleShooterArrow[] Arrows
        {
            get;
            set;
        }


        protected Rectangle[] standard;

        public CastleSprite(Game game, Vector2 position, bool active, int maxLoopTime, SpriteEnumState state)
            : base(game, position, active, maxLoopTime, state)
        {
            Health = 1000;
            MaxHealth = 1000;
            standard = new Rectangle[1];
            //State = SpriteEnumState.Past;
        }

         public override void Update(GameTime gameTime)
         {
             base.Update(gameTime);
         }

         public abstract void Upgrade(SpriteEnumState state);

         public void UpgradeCastleParts(Age age)
         {
             switch (age)
             {
                 case Age.Past:
                     State = SpriteEnumState.Past;
                     break;
                 case Age.Present:
                     State = SpriteEnumState.Normal;
                     break;
                 case Age.Future:
                     State = SpriteEnumState.Future;
                     break;
                 default:
                     break;
             }
             texture = getTexture();
         }

         protected override Texture2D getTexture()
         {
             string assetName = ("level\\castle\\" + GetName());
             manager.LoadAsset(assetName);
             return manager.UseAsset(assetName);
         }

         public abstract string GetName();
    }
}
